<?php

Yii::setPathOfAlias('bootstrap', dirname(__FILE__) . '/../extensions/bootstrap');
return CMap::mergeArray(require(dirname(__FILE__) . '/main.php'), array(
        'name' => 'Back End',
//            'defaultController' => 'admin',
        'components' => array(
            'bootstrap' => array(
                'class' => 'bootstrap.components.Bootstrap',
                'responsiveCss' => true,
            ),
            'user' => array(
                'loginUrl' => array('site/login'),
                'allowAutoLogin' => true,
            ),
            'urlManager' => array(
                'urlFormat' => 'path',
                'showScriptName' => false,
                'rules' => array(
                    'admin' => 'site/index',
                    'admin/login' => 'site/login',
                    'admin/gia-dang-tin' => 'giadangtin/index',
                    'admin/gia-dang-tin/<id:\d+>' => 'giadangtin/view',
                    'admin/gia-dang-tin/<action:\w+>/<id:\d+>' => 'giadangtin/<action>',
                    'admin/<controller>' => '<controller>/index',
                    'admin/<controller:\w+>/<id:\d+>' => '<controller>/view',
                    'admin/<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                    'admin/<controller:\w+>/<action:\w+>' => '<controller>/<action>',
                ),
            ),
            'errorHandler' => array(
                // use 'site/error' action to display errors
                'errorAction' => 'site/error',
            ),
            'authManager' => array(
                'class' => 'CDbAuthManager',
                'connectionID' => 'db',
                'itemTable' => 'authitem',
                'itemChildTable' => 'authitemchild',
                'assignmentTable' => 'authassignment',
                'defaultRoles' => array('guest'),
            ),
        ),
    )
);
